package com.changli08.innerClass;

public class OuterClass {
    public static void main(String[] args) {

        //创建内部类 ①
        Person.Dog dog = new Person.Dog();
        dog.eat();
//    ②
        Person p1 = new Person();
        Person.Bird bird1 = p1.new Bird();
        bird1.eat();
        bird1.show("kasla");

    }
}
class Person {
    String name  = "sail1";
    //成员内部类

    //内部类 --静态
    static class Dog{
        public void eat(){
            System.out.println("狗吃骨头");
        }
    }
//    内部类 ---非静态
    class Bird {
        String name = "百灵鸟";
        public void eat(){
            System.out.println("鸟吃虫子");
        }
        public void show(String name ){
            System.out.println(name);
            System.out.println(this.name);
            System.out.println(Person.this.name);
        }



}
//         局部 内部类 ---构造器、方法、代码块

}
